
	<script type="text/javascript">

		
    var map;
    var geocoder;
		var i = 0;
    var address;
	

    function initialize() {
			if (GBrowserIsCompatible()) {   
			map = new GMap2(document.getElementById("map_canvas"));
	    map.setCenter(new GLatLng(37.4419, -122.1419), 13);
	
	    map.addControl(new GLargeMapControl);
	    map.addControl(new GMapTypeControl());
	    geocoder = new GClientGeocoder();	
			
			<% for entry in @entries do %>
			var addr = new String(<%= '"' %> <%= entry.addr.to_s %><%= '"' %>);
	    address = addr;
			
			function createMarker(latlng) {
						var test = latlng.lat();
						var marker = new GMarker(latlng);
						
			if (i == 0){
						i = i +1;	
		  map.setCenter(marker.getLatLng(), 13);
	    }

	    map.addOverlay(marker);
			
    }
			
			
	    geocoder.getLatLng(address, createMarker);

			<% end %>		
			}
    }




    </script>

    <div id="map_canvas" style="width: 500px; height: 400px"></div>

